Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker-platform-monitor] Check if sonic_platform package is available before checking if installed #5764

Merged
merged 1 commit into from
Nov 1, 2020
Merged

Conversation

jleveque
Copy link
Contributor

- Why I did it

On Arista platforms, sonic_platform packages are not installed in the PMon container, but are rather mounted into the container from the host OS. Therefore, pip show sonic_platform will fail in the PMon container. This change will first check if we can import sonic_platform. If this fails, it will then fall back to checking if the package is installed. If both fail, it will attempt to install the package.

@jleveque jleveque requested a review from lguohan October 31, 2020 00:55
@jleveque jleveque self-assigned this Oct 31, 2020
@jleveque
Copy link
Contributor Author

@Staphylo: Please review.

@lguohan lguohan merged commit f2a258a into sonic-net:master Nov 1, 2020
@jleveque jleveque deleted the pmon_sonic_platform_check branch November 2, 2020 17:29
@Staphylo
Copy link
Collaborator

Staphylo commented Nov 2, 2020

A bit late to the party but this will work perfectly with our current approach.
Thanks for the heads up Joe.

santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
… installed (sonic-net#5764)

On Arista platforms, sonic_platform packages are not installed in the PMon container, but are rather mounted into the container from the host OS. Therefore, pip show sonic_platform will fail in the PMon container. This change will first check if we can import sonic_platform. If this fails, it will then fall back to checking if the package is installed. If both fail, it will attempt to install the package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants